import 'package:aichat_flutter_wallet/module_common/utils/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class DappTips extends StatelessWidget {
  final String title;
  double width;
  DappTips({super.key, required this.title, this.width = 1});

  @override
  Widget build(BuildContext context) {
    return Stack(
      clipBehavior: Clip.none,
      children: [
        Container(
          padding: EdgeInsets.symmetric(horizontal: 5.w, vertical: 2.w),
          constraints: BoxConstraints(maxWidth: 60.w, minWidth: 25.w),
          decoration: BoxDecoration(
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(16.w),
                topRight: Radius.circular(16.w),
                bottomLeft: Radius.circular(2.w),
                bottomRight: Radius.circular(16.w)),
            color: Colors.white,
            gradient: LinearGradient(
              begin: Alignment.topLeft,
              end: Alignment.bottomRight,
              colors: [
                Color.fromRGBO(185, 156, 255, 1),
                Color.fromRGBO(122, 88, 255, 1),
              ],
            ),
          ),
          child: Text(
            title,
            overflow: TextOverflow.ellipsis,
            textAlign: TextAlign.center,
            maxLines: 1,
            style: TextStyle(
              fontSize: 8.sp,
              fontWeight: FontWeight.w400,
              color: Color.fromRGBO(255, 255, 255, 1),
            ),
          ),
        ),
        Positioned(
            left: 0,
            bottom: -1.w,
            right: -2.w,
            top: -1.w,
            child: Container(
              decoration: BoxDecoration(
                border: Border.all(width: width, color: AppColors.c_white),
                borderRadius: BorderRadius.only(
                    topLeft: Radius.circular(16.w),
                    topRight: Radius.circular(16.w),
                    bottomLeft: Radius.circular(2.w),
                    bottomRight: Radius.circular(16.w)),
              ),
            ))
      ],
    );
  }
}
